package com.hooper.iot.resource.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

@Component
@FeignClient(name = "unifyDeviceFeign", url = "${feign.cdevice}")
public interface UnifyDeviceFeign {

    /**
     * 按设备ID查询
     */
    @RequestMapping(value = {"/device/ext"}, method = RequestMethod.GET)
    String findDeviceById(@RequestParam(value = "f_in_id") String f_in_id,
                          @RequestParam(value = "paging") boolean paging,
                          @RequestParam(value = "includes") String includes);

    /**
     * 按设备类型查询
     */
    @RequestMapping(value = {"/device/ext"}, method = RequestMethod.GET)
    String findDeviceByType(@RequestParam(value = "f_in_deviceType") String f_in_deviceType,
                            @RequestParam(value = "paging") boolean paging,
                            @RequestParam(value = "includes") String includes);

    @RequestMapping(value = {"/device/ext"}, method = RequestMethod.GET)
    String findDeviceByTypeAndAccessId(@RequestParam(value = "f_eq_deviceAttr.faceterminal.accessId") String accessId,
                                       @RequestParam(value = "f_eq_deviceType") String unifyType,
                                       @RequestParam(value = "paging") boolean paging,
                                       @RequestParam(value = "includes") String includes);
}
